const config = require('../config/sysConfig')
const time = '1000h'
const jwt = require("jsonwebtoken")
const JWT = {
  setToken:(option)=>{
    return jwt.sign(option,config.secret,{expiresIn: time})
  },
  verifyToken:(token)=>{
    try {
      return jwt.verify(token, secret)
    } catch (error) {
      console.log(error)
      return false
    }
  }
}
module.exports = JWT